Skip to content

Fix the Olimex udev rules: drop the 0x prefix - #301

Merged
bugadani merged 1 commit into
probe-rs:masterfrom
jmrplens:fix/udev-olimex-ids
Oct 1, 2026
Merged

bugadani merged 1 commit into
probe-rs:masterfrom
jmrplens:fix/udev-olimex-ids

Conversation

@jmrplens

Copy link
Copy Markdown
Contributor

The four Olimex lines in public/files/69-probe-rs.rules write the IDs as "0x15ba", "0x0003" and so on. udev compares ATTRS{idVendor} and ATTRS{idProduct} as strings against the sysfs values, which are four lowercase hex digits without a prefix (/sys/bus/usb/devices/*/idVendor holds 15ba), so these rules never match, and ARM-USB-OCD, ARM-USB-TINY, ARM-USB-TINY-H and ARM-USB-OCD-H users get neither the plugdev group nor the uaccess tag from this file. Every other line in the file already uses the plain form.

I checked the matching with udevadm test (udev 257, Debian trixie) against a USB root hub (1d6b:0002): a rule with ATTRS{idVendor}=="1d6b", ATTRS{idProduct}=="0002" matched, and the same rule with "0x1d6b" and "0x0002" did not.

The lines have had the prefix since they were added in #113, and #200 carries them over unchanged. This PR only touches those four lines, so it does not overlap with #293.

I do not have an Olimex adapter here, so this is verified against udev's matching, not against the hardware.

udev compares ATTRS{idVendor} and ATTRS{idProduct} as strings
against the sysfs values, which are four lowercase hex digits
without a prefix (15ba, 002a). The Olimex lines were written as
"0x15ba" and "0x002a", so they never matched and those adapters
got neither the plugdev group nor the uaccess tag.

Checked with udevadm test (udev 257) on a USB device: the rule with
plain IDs matched, the same rule with 0x-prefixed IDs did not.
@bugadani
bugadani merged commit f9c2835 into probe-rs:master Oct 1, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants